<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>




<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 控制台主页一</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css" media="all">

</head>
<body>

<div class="layui-fluid">
  <div class="layui-row layui-col-space10">
    <%--<div class="layui-col-md8">
        <div class="layui-row layui-col-space15">


        </div>
    </div>--%>

    <div class="layui-col-md8">
      <div class="layui-card">
        <div class="layui-card-header">版本信息</div>
        <div class="layui-card-body layui-text">
          <table class="layui-table">
            <colgroup>
              <col width="100">
              <col>
            </colgroup>
            <tbody>
            <tr>
              <td>当前版本</td>
              <td>
                <script type="text/html" template>
                  V1.0.0
                  校园失物管理系统
                </script>
              </td>
            </tr>
            <tr>
              <td>基于框架</td>
              <td>
                前端框架：Layui，后端框架：SSM
                开发语言：Java
                源码作者:xx制作
              </td>
            </tr>
            <tr>
              <td>主要特色</td>
              <td>零门槛 / 响应式 / 清爽 / 极简</td>
            </tr>
            <tr>
              <td>获取渠道</td>
              <td style="padding-bottom: 0;">
                <div class="layui-btn-container">
                  <a href="http://www.layui.com/admin/" target="_blank" class="layui-btn layui-btn-danger">获取授权</a>
                  <a href="http://fly.layui.com/download/layuiAdmin/" target="_blank" class="layui-btn">立即下载</a>
                </div>
              </td>
            </tr>
            </tbody>
          </table>
        </div>
      </div>

      <%--<div class="layui-card">
          <div class="layui-card-header">效果报告</div>
          <div class="layui-card-body layadmin-takerates">
              <div class="layui-progress" lay-showPercent="yes">
                  <h3>转化率（日同比 28% <span class="layui-edge layui-edge-top" lay-tips="增长" lay-offset="-15"></span>）</h3>
                  <div class="layui-progress-bar" lay-percent="65%"></div>
              </div>
              <div class="layui-progress" lay-showPercent="yes">
                  <h3>签到率（日同比 11% <span class="layui-edge layui-edge-bottom" lay-tips="下降" lay-offset="-15"></span>）</h3>
                  <div class="layui-progress-bar" lay-percent="32%"></div>
              </div>
          </div>
      </div>
--%>
      <div class="layui-card" id="chartmain">

      </div>

      <%--<div class="layui-card">
          <div class="layui-card-header">产品动态</div>
          <div class="layui-card-body">
              <div class="layui-carousel layadmin-carousel layadmin-news" data-autoplay="true" data-anim="fade" lay-filter="news">
                  <div carousel-item>
                      <div><a href="http://fly.layui.com/docs/2/" target="_blank" class="layui-bg-red">layuiAdmin 快速上手文档</a></div>
                      <div><a href="http://fly.layui.com/vipclub/list/layuiadmin/" target="_blank" class="layui-bg-green">layuiAdmin 会员讨论专区</a></div>
                      <div><a href="http://www.layui.com/admin/#get" target="_blank" class="layui-bg-blue">获得 layui 官方后台模板系统</a></div>
                  </div>
              </div>
          </div>
      </div>--%>
      <%--
                  <div class="layui-card">
                      <div class="layui-card-header">
                          作者心语
                          <i class="layui-icon layui-icon-tips" lay-tips="要支持的噢" lay-offset="5"></i>
                      </div>
                      <div class="layui-card-body layui-text layadmin-text">
                          <p>一直以来，layui 秉承无偿开源的初心，虔诚致力于服务各层次前后端 Web 开发者，在商业横飞的当今时代，这一信念从未动摇。即便身单力薄，仍然重拾决心，埋头造轮，以尽可能地填补产品本身的缺口。</p>
                          <p>在过去的一段的时间，我一直在寻求持久之道，已维持你眼前所见的一切。而 layuiAdmin 是我们尝试解决的手段之一。我相信真正有爱于 layui 生态的你，定然不会错过这一拥抱吧。</p>
                          <p>子曰：君子不用防，小人防不住。请务必通过官网正规渠道，获得 <a href="http://www.layui.com/admin/" target="_blank">layuiAdmin</a>！</p>
                          <p>—— 贤心（<a href="http://www.layui.com/" target="_blank">layui.com</a>）</p>
                      </div>
                  </div>--%>
    </div>

  </div>
</div>

<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js"></script>
<script src="${pageContext.request.contextPath}/static/js/echarts-all.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.js"></script>
<script>
  layui.config({
    base: '${pageContext.request.contextPath}/static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: '${pageContext.request.contextPath}/lib/index' //主入口模块
  }).use(['index']);
</script>
<script type="text/javascript">
  //指定图标的配置和数据
  var myChart = echarts.init(document.getElementById('chartmain'));
  var option = {
    title:{
      text:'年度项目数量'
    },
    tooltip:{},
    legend:{
      data:['用户来源']
    },
    xAxis:{
      data:["11","123"]
    },
    yAxis:{

    },
    series:[{
      name:'项目数量',
      type:'bar',
      data:[500,200,360,100]
    }]
  };
  //初始化echarts实例
  //var myChart = echarts.init(document.getElementById('chartmain'));
  $.ajax({
    type: 'POST',
    url: '${pageContext.request.contextPath}/report1Data.action',
    data: {},
    dataType: "json",
    success:function(result){
      console.log(result)
      var Item = function() {
        return {
          name : '项目数量',
          type : 'bar',
          data : []
        }
      };
      var legends = [];//线条类型
      var Series = [];//数据
      var names=[];//类别数组（实际用来盛放X轴坐标值）
      var xContent=result;
      var data = [];
      var data2 = [];
      var it = new Item();
      for (var key in xContent) {
        console.log(xContent[key],key);


        data.push(key);
        data2.push(xContent[key]);



      }
      it.data = data2;
      console.log("data:"+data);
      console.log("Series:"+Series);
      option.xAxis.data = data;
      option.legend.data = legends;
      option.series = it; // 设置图表
      myChart.hideLoading(); //隐藏加载动画
      myChart.setOption(option);// 重新加载图表
    },
    error:function(req){
      //请求出错处理
      console.log(req);
    }
  });

  //使用制定的配置项和数据显示图表
  myChart.setOption(option);

</script>
</body>
</html>

